//外观模式
class Sum {
    sum(a,b) {
        return a+b
    }
}
class Minus {
    minus(a,b) {
        return a-b
    }
}
class Mutiply {
    mutiply(a,b) {
        return a*b
    }
}
class Divide {
    divide(a,b) {
        return a/b
    }
};

class Calculator {
    constructor(){
        this.sum1 = new Sum();
        this.minus1 = new Minus();
        this.mutiply1 = new Mutiply();
        this.divide1 = new Divide();
    };
    sum (a,b) {
        return this.sum1.sum(a,b);
    };
    minus (a,b) {
        return this.minus1.minus(a,b);
    };
    mutiply (a,b) {
        return this.mutiply1.mutiply(a,b);
    };
    divide1 (a,b) {
        return this.divide1.divide(a,b);
    };
};
let calculator1 = new Calculator();
console.log(calculator1.sum(2,4));